﻿using EntityFramework.Entity.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YouTravel.DomainModels;

namespace Repositories.Configuration
{
    public class InvoiceSubjectMap : EntityConfigurationBase<InvoiceSubject>
    {
        public InvoiceSubjectMap()
        {
            this.Property(p => p.InvoiceSubjectName).HasMaxLength(50).IsRequired();

            this.HasRequired(p => p.Branch).WithMany().HasForeignKey(f => f.BranchId);
            this.HasRequired(p => p.Creater).WithMany().HasForeignKey(f=>f.CreaterId);
            this.HasRequired(p => p.Updater).WithMany().HasForeignKey(f=>f.UpdaterId);
        }
    }
}
